<?php $this->load->view('config/header');?>
<h1>Pages <small>form entry</small></h1>
<ol class="breadcrumb">
  <li><a href="<?php echo site_url()?>home"><i class="icon-dashboard"></i> Dashboard</a></li>
  <li><a href="<?php echo site_url()?>pages"><i class="icon-wrench"></i> Pages</a></li>
  <li class="active"><i class="icon-file-alt"></i> Form <?php echo $mode; ?></li>
</ol>

<form class="form-horizontal" role="form" method="post" action="<?php echo site_url() ?>pages/<?php echo $action; ?>" enctype="multipart/form-data">
	<input type="hidden" class="form-control" name="id_page" value="<?php echo @$detail[0]['id_page']?>">
	<div class="form-group">
		<label for="region_page" class="col-lg-2 control-label">Region Page</label>
		<div class="col-lg-6">
			<?php $selected1 =  ''; ?>
			<?php $selected2 =  ''; ?>
			<select class="form-control" name="region_page">
				<?php if (@$detail[0]['region_page'] == 1):?>
					<?php $selected1 =  'selected="selected"' ?>
				<?php elseif (@$detail[0]['region_page'] == 2):?>
					<?php $selected2 =  'selected="selected"' ?>
				<?php else :?>
					<?php $selected1 =  ''; ?>
					<?php $selected2 =  ''; ?>
				<?php endif;?>
				<option value="1" <?php echo $selected1; ?>>Display Promo Product</option>
				<option value="2" <?php echo $selected2; ?>>Display Label Product</option>
			</select>
		</div>
	</div>
	<div class="form-group">
		<label for="file_page" class="col-lg-2 control-label">File Page</label>
		<div class="col-lg-6">
			<?php if(@$detail[0]['file_page'] == "" || @$detail[0]['file_page'] == "0"):?>
				<input type="file" class="form-control" name="file_page"></input>
			<?php else:?>
				<input type="text" class="form-control" name="file_page" value="<?php echo @$detail[0]['file_page']?>" readonly="readonly"/>
			<?php endif;?>
		</div>
	</div>
	<div class="form-group">
		<label for="description_page" class="col-lg-2 control-label">Description page</label>
		<div class="col-lg-6">
			<textarea name="description_page" class="form-control" cols="88" rows="5" style="resize:none;"><?php echo @$detail[0]['description_page']?></textarea>
		</div>
	</div>
	<div class="form-group">
		<div class="col-lg-offset-2 col-lg-10">
			<input type="submit" name="submit" value="Simpan" class="btn btn-primary"/>
			<a href="<?php echo site_url()?>pages" class="btn btn-primary">Batal</a>
		</div>
	</div>
</form>

<?php $this->load->view('config/footer');?>